package com.corpgovernment.organization.mapper;


import com.corpgovernment.organization.common.mybatis.TkMapper;
import com.corpgovernment.organization.dto.UserLoginDTO;
import com.corpgovernment.organization.entity.db.MbUserLogin;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * MbUserLoginMapper数据库操作接口类
 **/
@Repository
public interface MbUserLoginMapper extends TkMapper<MbUserLogin> {

	int deleteByUid(@Param("uid") String uid);

	int updatePwd(MbUserLogin model);

	int updateUnBindPhone(@Param("accountName") String accountName);

	/**
	 * @param accountName       账户名
	 * @param username          用户名
	 * @param certificateNumber 证件号码
	 * @param email             邮箱
	 * @param isEnabled         账号状态
	 * @return
	 */
	List<UserLoginDTO> listByCondition(@Param("accountName") String accountName, @Param("username") String username,
	                                   @Param("certificateNumber") String certificateNumber, @Param("email") String email,
	                                   @Param("isEnabled") Boolean isEnabled);

	/**
	 * @param accountName
	 * @param email
	 * @param status
	 * @param orgIds
	 * @param uids
	 * @return
	 */
	List<MbUserLogin> listByRelationCondition(@Param("accountName") String accountName, @Param("email") String email,
											  @Param("status") Integer status, @Param("orgIds") List<String> orgIds,
											  @Param("uids") List<String> uids);
}